from PIL import Image , ImageFilter

image = Image.open("gx.png")
image.format,image.size,image.mode
#image.show()
#1.裁剪图像
rect = 80,20,310,360
#image.crop(rect).show()

#2生成缩略图
size = 128, 128
#image.thumbnail(size)
#image.show()

#缩放和黏贴图像
image2 = Image.open('./image-show.png')
rect = 80, 20, 310, 360
guido_head = image2.crop(rect)
width, height = guido_head.size
image.paste(guido_head.resize((int(width / 1.5), int(height / 1.5))), (172, 40))
image.show()

#滤镜效果
image2.filter(ImageFilter.CONTOUR).show()
